package 一对多通讯;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;

public class ClientDemo {
	public static void main(String[] args) throws IOException {
		Socket s=new Socket("zc521106", 9099);
		DataInputStream dis=new DataInputStream(s.getInputStream());
		DataOutputStream dos=new DataOutputStream(s.getOutputStream());
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		String info;
		while(true){
			info=br.readLine();
			if(info=="886"){
				break;
			}
			dos.writeUTF(info);
			info=dis.readUTF();
			if(info=="886"){
				break;
			}
			System.out.println("服务器："+info);
		}
		br.close();
		s.close();
	}

}